package com.db.workcall;
import com.ibatis.common.resources.*;
import com.ibatis.sqlmap.client.*;
import com.sun.corba.se.spi.orbutil.threadpool.Work;

import java.io.*;
import java.util.*;

import org.springframework.orm.ibatis.SqlMapClientTemplate;

public class WorkCallDAO {
	private SqlMapClientTemplate template;
	
	
	public void setTemplate(SqlMapClientTemplate template) {
		this.template = template;
	}

	public void callInsert(WorkCallVO vo) throws Exception{
		template.insert("callInsert",vo);
	}
	
	public List<WorkCallVO> callSendView(int send) throws Exception{
		return template.queryForList("callSendView", send);
	}
	
	public List<WorkCallVO> callGetView(int get) throws Exception{
		return template.queryForList("callGetView", get);
	}
	
	public List<WorkCallVO> callGetTrash() throws Exception{
		return template.queryForList("callGetTrash");
	}
	
	public WorkCallVO sendContent(int no) throws Exception{
		return (WorkCallVO)template.queryForObject("sendContent",no);
	}
	
	public WorkCallVO getContent(int no) throws Exception{
		return (WorkCallVO)template.queryForObject("getContent",no);
	}
	
	public void callDelete(int sabun) throws Exception{
		template.delete("callDelete",sabun);
	}
	
	public void moveTrash(int no) throws Exception{
		template.update("moveTrash",no);
	}
	
	public int sendAllCount(int sabun) throws Exception{
		return (Integer)template.queryForObject("sendAllCount",sabun);
	}
	
	public int getAllCount(int sabun) throws Exception{
		return (Integer)template.queryForObject("getAllCount",sabun);
	}
	
	public int trashAllCount() throws Exception{
		return (Integer)template.queryForObject("trashAllCount");
	}
	
}







